package com.wxy.demo.client;

import com.wxy.demo.server.MyService;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 * @author wangxiaoyuan
 * 2021/3/19 15:26
 **/
public class CxfProxyClient {
    public static void main(String[] args) {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(MyService.class);
        factory.setAddress("http://localhost:8089/myservice?wsdl");
        // 需要服务接口文件
        MyService client = (MyService) factory.create();
        String result = client.authorization("admin", "123456");
        System.out.println(result);
    }
}
